﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using LitJson;
using System.Text;
using System.Data;

/// <summary>
///JsonBLL 的摘要说明
/// </summary>
public class JsonBLL
{
    public static string ToJson(object obj)
    {
        return Newtonsoft.Json.JsonConvert.SerializeObject(obj);
    }


    public static string ToJson(DataTable tb)
    {
        return Newtonsoft.Json.JsonConvert.SerializeObject(tb);
    }

    public static T ToObject<T>(string str)
    {
        return Newtonsoft.Json.JsonConvert.DeserializeObject<T>(str);
        //return JsonMapper.ToObject<T>(str);
    }
}